<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditPedidoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditPedidoLabel_id}" for="id" />
                    <h:inputText id="id" value="#{pedidoController.selected.id}" title="#{bundle.EditPedidoTitle_id}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditPedidoLabel_fecha}" for="fecha" />
                    <h:inputText id="fecha" value="#{pedidoController.selected.fecha}" title="#{bundle.EditPedidoTitle_fecha}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_fecha}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditPedidoLabel_total}" for="total" />
                    <h:inputText id="total" value="#{pedidoController.selected.total}" title="#{bundle.EditPedidoTitle_total}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_total}"/>
                    <h:outputLabel value="#{bundle.EditPedidoLabel_estadoId}" for="estadoId" />
                    <h:selectOneMenu id="estadoId" value="#{pedidoController.selected.estadoId}" title="#{bundle.EditPedidoTitle_estadoId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_estadoId}">
                        <f:selectItems value="#{estadoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditPedidoLabel_clienteId}" for="clienteId" />
                    <h:selectOneMenu id="clienteId" value="#{pedidoController.selected.clienteId}" title="#{bundle.EditPedidoTitle_clienteId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_clienteId}">
                        <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditPedidoLabel_borradoId}" for="borradoId" />
                    <h:selectOneMenu id="borradoId" value="#{pedidoController.selected.borradoId}" title="#{bundle.EditPedidoTitle_borradoId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_borradoId}">
                        <f:selectItems value="#{borradoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{pedidoController.update}" value="#{bundle.EditPedidoSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditPedidoViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{pedidoController.prepareList}" value="#{bundle.EditPedidoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditPedidoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
